#include<iostream>
#include<map>
using namespace std;

int main() {
    int n;
    map<string, unsigned int> mp; // 2^31用int会爆
    cin >> n;
    while(n--) {
        int t, score;
        string name;
        cin >> t;
        switch(t) {
            case 1:
            cin >> name >> score;
            mp[name] = score;
            cout << "OK" << endl;
            break;
            case 2:
            cin >> name;
            if(mp.count(name))  cout << mp[name] << endl;
            else    cout << "Not found" << endl;
            break;
            case 3:
            cin >> name;
            if(mp.count(name)) {
                mp.erase(mp.find(name));
                cout << "Deleted successfully" << endl;
            } else  cout << "Not found" << endl;
            break;
            case 4:
            cout << mp.size() << endl;
            break;
            default:
            break;
        }
    }

    return 0;
} 